<!--
 * @Author: your name
 * @Date: 2021-02-26 09:22:44
 * @LastEditTime: 2021-02-26 16:38:47
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \web-app\src\views\Home\tabs.vue
-->
<template>
  <div>
    <ul class="tab" ref="tabs">
      <router-link
        class="item"
        v-for="(item, index) in tabs"
        :key="'home-tabs-' + index"
        :to="item.path"
        exact-active-class="active"
      >
        <span class="txt">{{item.name}}</span>
      </router-link>
    </ul>
  </div>
</template>

<script>

export default {
  name: 'tabs',
  data () {
    return {
      tabs: [
        { name: '首页', path: '/index' },
        { name: '提问', path: '/index/ask' },
        { name: '建议', path: '/index/advise' },
        { name: '分享', path: '/index/share' },
        { name: '讨论', path: '/index/discuss' }
      ]
    }
  },
  mounted () {
    const elem = this.$refs.tabs
    window.forbidScroll(elem)
  }
}
</script>
<style lang="scss" scoped>
@import './tabs.scss';
</style>
